<template>
  <div>
    <li class="list-group-item">
      <div class="handle">
        <a href="javascript:;" @click="delComment">删除</a>
      </div>
      <p class="user"><span>{{comment.username}}</span><span>说:</span></p>
      <p class="centence">{{comment.content}}</p>
    </li>
  </div>
</template>

<script>
  export default {
    name: "CommentItem",
    props:['comment','delComments'],
    methods:{
      delComment(){
        if (confirm(`您确定要删除用户:${this.comment.username}的评论吗?`)){
          // console.log(this.comment.id)
          this.delComments(this.comment.id)
        }
      }
    }
    
  }
</script>

<style scoped>

</style>